<template>
  <DetailDescTable ref="DetailDescTable" :title="$tt('label_container_detail')"  :descOption="detailDesc"
                   :url="detailUrl" :urlDataHandle="detailUrlDataHandle"/>
</template>

<script>
import DetailDescTable from "../detail_common.vue";
export default {
  name: "detail_container_type",
  components: {DetailDescTable},
  data() {
    return {
  
      detailUrl: '/wms-api/base/WmsBaseContainerTypeRpc/detail.json',
      detailUrlDataHandle: (res) => {
        let {compartmentList, ...descData} = res.data
        return {
          descData, tableData: compartmentList,
        }
      },

      detailDesc: {
        model: [
          {key: 'code', label: 'label_container_type_code'},
          {key: 'name', label: 'label_container_type_name'},
          {key: 'warehouseCode', label: 'label_warehouse_code'},
          {key: 'status', label: 'label_status', formatter: (r, c, v) => this.$enumShow(v, "IsAvailableStatusEnum")},

          {key: 'usageType', label: 'label_usage',formatter: (r, c, v) => this.$enumShow(v, "BaseContainerTypeEnum")},
          {key: 'length', label:'label_length',formatter: (r, c, v, i) => `${v}cm`},
          {key: 'width', label: 'label_width',formatter: (r, c, v, i) => `${v}cm`},
          {key: 'height', label: 'label_height',formatter: (r, c, v, i) => `${v}cm`},
          {key: 'volume', label: 'label_capacity',formatter: (r, c, v, i) => `${v}m³`},
          {key: 'weight', label: 'label_load_capacity',formatter: (r, c, v, i) => `${v}kg`},

          {key: 'useQty', label: 'label_used_count'},
          {key: 'freeQty', label: 'label_idle_count'},
          {key: 'unableQty', label: 'label_disabled_count'},
          {key: 'totalQty', label: 'label_sum'},

          {key: 'creator', label: 'label_create_user',},
          {key: 'gmtCreate', label: 'label_create_time', formatter: (r, c, v, i) => this.$dateFormat(v)}

        ],
      },
    }
  },
  methods: {
    show({title, ...obj}) {
      this.title = title
      this.$refs['DetailDescTable'].show(obj)

    },

    hide() {
      this.$refs['DetailDescTable'].hide()
    },

  }
}
</script>

<style scoped>

</style>
